# -*- coding:utf8-*-
import re

import requests

if __name__ == '__main__':
    header = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36"
    }
    content = requests.get("https://book.douban.com/", headers=header).text

    # print(content)
    pattern = re.compile('<li.*?cover.*?href="(.*?)".*?title="(.*?)".*?more-meta.*?author">(.*?).*?</span>.*?year">(.*?).*?</span>.*?</li>',re.S)
    result = re.findall(pattern, content)
    print(result)